<template>
  <el-radio-group
      v-bind="inputInfo.inputAttrs"
      v-model="value"
      @change="$emit('update:modelValue', value)">
    <el-radio
      v-bind="inputInfo.subAttrs"
      v-for="(value, label) in inputInfo.options"
      :key="label"
      :label="label"
    >{{value}}</el-radio>
  </el-radio-group>
</template>

<script>
import { defineComponent, ref } from "vue";

export default defineComponent({
  name: 'CommonRadio',
  props: {
    inputInfo: {
      type: Object,
      default: {}
    }
  },
  setup(props) {
    return {
      value: ref(props.inputInfo.value)
    }
  }
})
</script>

<style>

</style>